{% extends 'admin/index.html' %}
{% import "admin/admin_page.html" as pg %}

{% block script %}
<script>
    $(".selected").removeClass('selected');
    $("#leftNav").find("a:eq(3)").addClass("selected")
</script>
{% endblock %}

{% block content %}
    <div class="switch">
        <a href="/admin/menus"><label class="selectedswitch">自选套餐</label></a>
        <a href="/admin/menus/fixedpackage"><label>固定套餐</label></a>
    </div>


    <div class="button">
        <a class="breadhref" href="/admin/addmenu">
            添加
        </a>
    </div>
    
    <table>
        <tbody>
            <tr>
                <th>编号</th>
                <th>菜品名</th>
                <th>单价</th>
                <th>积分</th>
                <th>主料</th>
                <th>口味</th>
                <th>分类</th>
                <th>库存</th>
                <th>图片</th>
                <!-- <th>订餐方式</th> -->
                <th>操作</th>
            </tr>
            {% for pack in page_data.items %}
            <tr>
                <td>{{ pack.id }}</td>
                <td>{{ pack.cname }}</td>
                <td>{{ pack.cprice }}</td>
                <td>{{ pack.points }}</td>
                <td>
                    {% if pack.ingredients %}
                        {{ pack.ingredients }}
                    {% else %}
                        无
                    {% endif %}
                </td>
                <td>
                    {% if pack.taste %}
                        {{ pack.taste }}
                    {% else %}
                        无
                    {% endif %}
                </td>
                <td>{{ pack.type }}</td>
                <td>{{ pack.stock }}</td>
                <td>
                    <img style="width:70px;height:70px" src="/static/{{ pack.images }}">
                </td>
                <!-- <td>{{ pack.mealmeans }}</td> -->
                <td>
                    <p style="color:#fe4a00;margin-bottom: 4px">删除</p>
                    <a href="/admin/menus/edit/{{ pack.id }}"><p>修改</p></a>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
    <div class="box-footer clearfix">
        {{ pg.page(page_data,'admin.menu_view') }}
    </div>
{% endblock %}